<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function isRun (a) {
            if ( ( a % 4 == 0 && a % 100 != 0 ) || a % 400 == 0 ){
                return true ; 
            } else 
            {
                return false;
            }
        }
        function yearAtob (a,b) {
            var count = 0 ;
            var str = '' ;
            for ( var i = a ; i <= b ; i ++ ){
                if ( isRun(i) ){
                    count ++; 
                    str = str + "&nbsp;&nbsp;" + i ; 
                }
                // if ( count % 4 == 0 ){
                //     str = str + "</br>" ;
                // }
            }
            // document.write(str);
            return count ; 
        }
        console.log(yearAtob (1000,3000));
    </script>
</body>
</html>
